package com.saima.springcloud.controller;

import com.saima.springcloud.service.PaymentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author duPH
 * @date 2021/7/27 16:48
 */
@RestController
@RequestMapping("payment")
public class PaymentController {
    @Resource
    private PaymentService paymentService;

    @GetMapping("info/ok/{id}")
    public String getPaymentInfo_OK(@PathVariable("id") Integer id){
        return paymentService.getPaymentInfo_OK(id);
    }
    @GetMapping("info/error/{id}")
    public String getPaymentInfo_Error(@PathVariable("id") Integer id){
        return paymentService.getPaymentInfo_Error(id);
    }

    @GetMapping("info/circuit/{id}")
    public String paymentCircuitBreaker(@PathVariable("id") Integer id){
        return paymentService.paymentCircuitBreaker(id);
    }
}
